   public class BubbleSort {  
       public double[] bubbleSort(double[] array) {  
           int length = array.length - 1;  
            for (int out = length; out > 0; out--) {  
                for (int in = 0; in < out; in++) {  
                    if (array[in] > array[in + 1]) {  
                        double s = array[in];  
                        array[in] = array[in + 1];  
                        array[in + 1] = s;  
                   }  
               }  
           }
			return array;  
       }  
    
  }  